<html>
<head><meta charset="utf-8"><title>debugging llvm assertions · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html">debugging llvm assertions</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="136009010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/debugging%20llvm%20assertions/near/136009010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html#136009010">(Oct 17 2018 at 23:53)</a>:</h4>
<p>Does anyone have experience debugging failing llvm assertions? I managed to get a partial backtrace using lldb, but it's missing all the "in between" call locations (the ones that are inlined). I'm not sure it would actually help, either</p>



<a name="136009094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/debugging%20llvm%20assertions/near/136009094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html#136009094">(Oct 17 2018 at 23:54)</a>:</h4>
<p>This is the one I'm getting:</p>
<div class="codehilite"><pre><span></span>rustc: /users/mahewson/rust2/src/llvm/lib/IR/Value.cpp:256: void llvm::Value::setNameImpl(const llvm::Twine&amp;): Assertion `!getType()-&gt;isVoidTy() &amp;&amp; &quot;Cannot assign a name to void values!&quot;&#39; failed.
</pre></div>



<a name="136045132"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/debugging%20llvm%20assertions/near/136045132" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html#136045132">(Oct 18 2018 at 14:01)</a>:</h4>
<p>Usually what I do is first see what is the source of an assertion</p>



<a name="136045153"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/debugging%20llvm%20assertions/near/136045153" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html#136045153">(Oct 18 2018 at 14:02)</a>:</h4>
<p>if it comes from deep within LLVM while it is optimising stuff, it is usually an LLVM’s fault</p>



<a name="136045221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/debugging%20llvm%20assertions/near/136045221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html#136045221">(Oct 18 2018 at 14:02)</a>:</h4>
<p>in that case I just use LLVM’s logging functionality (<code>-debug</code>, <code>-print-after-all</code>, <code>-print-before-all</code> and friends)</p>



<a name="136077832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/debugging%20llvm%20assertions/near/136077832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/debugging.20llvm.20assertions.html#136077832">(Oct 18 2018 at 23:07)</a>:</h4>
<p>OK thanks. Yeah, it's during lto, so I guess a full backtrace wouldn't show any of the code that I worked on, instead it's the generated IR that's triggering the assertion failure somehow</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>